DEBUG = y

ifeq ($(DEBUG),y)
  DEBFLAGS = -O -g -DDEBUG_LAGZOR # "-O" is needed to expand inlines
else
  DEBFLAGS = -O2
endif

EXTRA_CFLAGS += $(DEBFLAGS)
PWD       := $(shell pwd)

ifneq ($(KERNELRELEASE),)
# call from kernel build system

#obj-m	:= simple.o
obj-m := src/xt_lagzify.o
lagzor-y := src/xt_lagzify.c

else

KERNELDIR ?= /lib/modules/$(shell uname -r)/build
default:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
	$(MAKE) -C $(PWD)/src/libxt_LAGZIFY
endif



clean:
	rm -rf Module.markers modules.order Module.symvers *.o *.ko *.mod.c *.mod.o .tmp_versions \
	./src/*.o ./src/*.ko ./src/*.mod.c ./src/*.mod.o ./src/*.cmd
